package com.yl.auth.controller;


import com.yl.auth.entity.Chuyuanguanli;
import com.yl.auth.service.ChuyuanguanliService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author L
 * @since 2023-07-26
 */
@RestController
@RequestMapping("/admin/auth/chuyuanguanli")
@Api(tags = "出院记录")
public class ChuyuanguanliController {
    @Resource
    private ChuyuanguanliService chuyuanguanliService;

    /**
     * 查询出院记录
     */
    @ApiOperation(value = "出院记录")
    @GetMapping("/getchuyuan/{id}")
    public Result getchuyuan(@PathVariable @ApiParam("老人id") Long id){
        List<Chuyuanguanli> list=chuyuanguanliService.getchuyuan(id);
        return Result.ok(list);
    }

    /**
     * 新增出院记录
     */
    @ApiOperation(value = "新增出院记录")
    @PostMapping("/savechuyuan")
    public Result savechuyuan(@RequestBody Chuyuanguanli chuyuanguanli){
        chuyuanguanliService.save(chuyuanguanli);
        return Result.ok();
    }
}

